﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Business_YiWu_PlanShow : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Request.QueryString["id"] != null && Request.QueryString["id"].ToString() != "")
            {
                #region 信息获取

                Cisoft.YiWu.BLL.PlanInfoBO bll = new Cisoft.YiWu.BLL.PlanInfoBO();

                DataSet ds = bll.GetModelAllInfo(int.Parse(Request.QueryString["id"].ToString()));

                if (ds.Tables[0].Rows.Count > 0)
                {

                    

                    //预约时间
                    Label1.Text = Cisoft.IntegrationSystem.Common.DateTimeHelper.GetChinaShortDateAndWeeky(System.Convert.ToDateTime(ds.Tables[0].Rows[0]["PI_PlanTime"].ToString())) + ds.Tables[0].Rows[0]["TS_SliceName"].ToString();
                    //患者姓名
                    Label2.Text = ds.Tables[0].Rows[0]["PI_Name"].ToString();
                    //性别
                    Label3.Text = ds.Tables[0].Rows[0]["PI_Sex"].ToString();
                    //年龄
                    Label4.Text = ds.Tables[0].Rows[0]["PI_Age"].ToString();
                    //联系地址
                    Label5.Text = "";
                    //手机
                    Label6.Text = ds.Tables[0].Rows[0]["PI_MobileNum"].ToString();
                    //预约医院
                    Label7.Text = ds.Tables[0].Rows[0]["HI_HospitalName"].ToString();
                    //预约留言
                    Label8.Text = HtmlDecode(ds.Tables[0].Rows[0]["PI_Summary"].ToString());
                    //预约科类
                    Label9.Text = ds.Tables[0].Rows[0]["DI_DepartmentlName"].ToString();
                    //医生
                    //Label10.Text = strInfoarray[9];
                    //地址
                    //Label11.Text = strInfoarray[10];
                }


                #endregion
            }
            else
            {
                Response.Redirect("PlanManage.aspx");
            }
        }
    }

    #region 返回事件
    /// <summary>
    /// 返回事件
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void ibtnCannel_Click(object sender, ImageClickEventArgs e)
    {
        Response.Redirect("PlanManage.aspx");
    }
    #endregion

    #region HTML解码 public static string HtmlDecode(string value)
    /// <summary>
    /// HTML解码
    /// </summary>
    /// <param name="value"></param>
    /// <returns></returns>
    public static string HtmlDecode(string value)
    {
        if (!string.IsNullOrEmpty(value))
        {
            value = value.Replace("<br>", "\n");
            value = value.Replace("& gt;", ">");
            value = value.Replace("& lt;", "<");
            value = value.Replace("& nbsp;", " ");
            value = value.Replace("& #39;", "'");
            value = value.Replace("& quot;", "\"");
        }
        return value;
    }
    #endregion
}
